Xbasic

cron_nextExecutionTime Function

IN THIS PAGE

Syntax

Result as C = cron_nextExecutionTime(cronExpression as C)

Arguments

cronExpressionCharacter

The CRON expression for which to compute the next execution time.

Returns

ResultCharacter

The next execution time for the CRON expression, formatted as a date/time string (for example, an ISO 8601 timestamp with timezone offset). If the expression is invalid, an error may be returned.

Description

Returns the next execution time for a CRON expression as a date/time string.

Description

Use cron_nextExecutionTime() to determine when a CRON schedule will next fire. The function evaluates the supplied CRON expression relative to the current server time and returns the next matching date and time.

This can be useful for diagnostics, logging, administration tools, or any UI where you need to show the next time a scheduled task is expected to run.

Example

The following example uses a CRON expression that fires every 15 minutes.

dim cronExpression as c
cronExpression = "*/15 * * * *"

? cron_nextExecutionTime(cronExpression)
= "2025-09-06T18:15:00.000-04:00"

See Also